package com.design.callback;

/**
 * 
 * 模拟客户端
 *
 */
public class Client implements CSCallBack {

	private Server server;

	public Client(Server server) {
		this.server = server;
	}

	public void sendMsg(final String msg) {
		System.out.println("客户端发送消息:" + msg);

		new Thread(() -> {
			server.getClientMsg(Client.this, msg);
		}).start();
		System.out.println("客户端异步发送成功");

	}

	@Override
	public void process(String status) {
		System.out.println("客户端收到服务端回调状态:" + status);
	}

}
